Skip to content

Conversation

@Anemy
Copy link
Member

@Anemy Anemy commented Jul 10, 2025

re https://mongodb.slack.com/archives/C08P2P6ADJL/p1751386769660719

Drive by updated a test to be time zone independent (it failed on my local, maybe it passes in the EU?)

before after
Screenshot 2025-07-10 at 12 33 00 AM Screenshot 2025-07-10 at 12 32 39 AM

…espace, update test to be timezone independent
Copilot AI review requested due to automatic review settings July 10, 2025 05:19
@Anemy Anemy requested a review from a team as a code owner July 10, 2025 05:19
@Anemy Anemy added the no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion) label Jul 10, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Updates the display title for diagram nodes to use the collection name rather than the full namespace and tweaks a test’s timestamps for timezone independence.

  • Switch node title from ns to the parsed collection via toNS
  • Import toNS utility in the diagram editor
  • Adjust test timestamps to avoid timezone-related failures

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/compass-data-modeling/src/components/diagram-editor.tsx Use toNS(coll.ns).collection for node titles
packages/compass-data-modeling/src/components/diagram-card.spec.tsx Modify timestamp fixtures for timezone independence
Comments suppressed due to low confidence (1)

packages/compass-data-modeling/src/components/diagram-editor.tsx:239

  • Consider adding a unit or integration test to assert that the node’s title renders the collection name (from toNS) instead of the full namespace, ensuring future changes don’t regress this behavior.
        title: toNS(coll.ns).collection,

createdAt: '2023-10-01T00:00:00.000Z',
updatedAt: '2023-10-03T00:00:00.000Z',
createdAt: '2021-10-01T00:00:00.000Z',
updatedAt: '2023-10-03T00:00:00.000',
Copy link

Copilot AI Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ISO timestamp is missing the Z timezone designator, which may cause inconsistent parsing across environments; consider restoring the trailing Z for a fully qualified UTC time string.

Suggested change
updatedAt: '2023-10-03T00:00:00.000',
updatedAt: '2023-10-03T00:00:00.000Z',

Copilot uses AI. Check for mistakes.
Copy link
Member Author

@Anemy Anemy Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We render it based on the user's time zone so the change here is making it less brittle.

We could change what we're looking for in the check to be on of two days if we want, or something else entirely, I don't think it's worth spending too much time on.

Copy link
Collaborator

@paula-stacho paula-stacho Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting.. maybe we could fix the timezone for the tests? So that we don't need to think about this for future tests, since it's apparently easy to miss for us Europeans 😅
I couldn't find a mocha setting but we could change the npm scripts to: "test": "TZ=UTC mocha",.

@Anemy Anemy merged commit 75c1c9b into main Jul 10, 2025
32 of 35 checks passed
@Anemy Anemy deleted the update-node-titles branch July 10, 2025 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants